/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hibernate.model.dao;

import hibernate.pojo.Thanhtoantang;
import hibernate.pojo.Thanhtoantructuyen;
import hibernate.util.HibernateUtil;
import org.hibernate.Transaction;
import org.hibernate.HibernateException;
import org.hibernate.Session;
/**
 *
 * @author phathuynh
 */
public class ThanhToanTangDAO {
    //<editor-fold defaultstate="collapsed" desc="1. Thanh toán tặng bạn bè">
    public static boolean  addPresentOrder(Thanhtoantang ttt){
        Session session = HibernateUtil.getSessionFactory().openSession();
        Transaction tran = null;
        try{
            tran = (Transaction) session.beginTransaction();
            session.save(ttt);
            tran.commit();
        }catch(HibernateException hex){
            System.err.print(session);
            tran.rollback();
            return false;
        }finally{
            session.close();
        }
        return true;
    }
    
    //</editor-fold>
}
